package com.logger.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class LoggerController {
	Logger logger= LoggerFactory.getLogger(getClass());
	@GetMapping("/logs")
	void printLog(){
		logger.trace("trace级别的日志");
		logger.debug("debug级别的日志");
		logger.info("info级别的日志");
		logger.warn("warn级别的日志");
		logger.error("error级别的日志");
	}
	@GetMapping("/log")
	void testAuthor(){
		log.warn("lombok加Slf4j注解创建日志对象");
	}
}
